package com.sansecy.customview.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.sansecy.customview.R;

public class HorizontalScaleProgressBarActivity extends AppCompatActivity {
    private static final String TAG = "HorizontalScaleProgress-App";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_horizontal_scale_progress_bar);
        final TextView textView = findViewById(R.id.textView);

        final HorizontalScaleProgressBar seekBar = findViewById(R.id.seekBar);
        seekBar.setSplitTrack(false);
        seekBar.setMax(1000);
        seekBar.setProgress(550);
        seekBar.setOnScaleChangeListener(new HorizontalScaleProgressBar.OnScaleChangeListener() {
            @Override
            public void onScaleChange(int scale) {
                textView.setText(String.valueOf(scale));
            }
        });
        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                int scaleCount = seekBar.getScaleCount();
                seekBar.setScaleCount(scaleCount + 1);
            }
        });
    }
}